package com.pgeneral.user.management.service.impl;

import com.pgeneral.user.management.dao.UserSoproleMapper;
import com.pgeneral.user.management.entity.UserSopRole;
import com.pgeneral.user.management.entity.UserUserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import com.pgeneral.user.management.dao.UserSopscopedataMapper;

import java.util.ArrayList;
import java.util.List;

import com.pgeneral.user.management.entity.UserSopScopeData;
import com.pgeneral.user.management.service.UserSopscopedataService;

@Service
public class UserSopscopedataServiceImpl implements UserSopscopedataService {

    @Resource
    private UserSopscopedataMapper dao;

    @Override
    public List<UserSopScopeData> getUserSopScopeDataAll() {
        List<UserSopScopeData> userSopScopeDataAllLists = dao.getUserSopScopeDataAll();

        //如果查询的权限都为空
        if (userSopScopeDataAllLists.isEmpty()) {
            return new ArrayList<>();
        }
        return userSopScopeDataAllLists;
    }

    @Override
    public List<UserUserInfo> getUserInfoByScopeId(String scopeId) {
        return dao.getUserInfoByScopeId(scopeId);
    }

}
